﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Guestbook.aspx.cs" Inherits="admin_Guestbook" StylesheetTheme="admin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        客户留言管理<br />
        <hr />
    
    </div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
            CellPadding="3" DataKeyNames="id" DataSourceID="SqlDataSource1" Width="728px" OnRowDataBound="GridView1_RowDataBound">
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="序号" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:BoundField DataField="Name" HeaderText="姓名" SortExpression="Name" />
                <asp:BoundField DataField="Title" HeaderText="标题" SortExpression="Title" />
                <asp:BoundField DataField="Content" HeaderText="内容" SortExpression="Content" />
                <asp:BoundField DataField="SendTime" HeaderText="提交时间" SortExpression="SendTime" />
                <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
            </Columns>
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [GuestBook] WHERE [id] = @original_id "
            InsertCommand="INSERT INTO [GuestBook] ([Name], [Title], [Content], [SendTime]) VALUES (@Name, @Title, @Content, @SendTime)"
            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [id], [Name], [Title], [Content], [SendTime] FROM [GuestBook]"
            UpdateCommand="UPDATE [GuestBook] SET [Name] = @Name, [Title] = @Title, [Content] = @Content, [SendTime] = @SendTime WHERE [id] = @original_id AND [Name] = @original_Name AND [Title] = @original_Title AND [Content] = @original_Content AND [SendTime] = @original_SendTime">
            <DeleteParameters>
                <asp:Parameter Name="original_id" Type="Int32" />
                <asp:Parameter Name="original_Name" Type="String" />
                <asp:Parameter Name="original_Title" Type="String" />
                <asp:Parameter Name="original_Content" Type="String" />
                <asp:Parameter Name="original_SendTime" Type="DateTime" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Content" Type="String" />
                <asp:Parameter Name="SendTime" Type="DateTime" />
                <asp:Parameter Name="original_id" Type="Int32" />
                <asp:Parameter Name="original_Name" Type="String" />
                <asp:Parameter Name="original_Title" Type="String" />
                <asp:Parameter Name="original_Content" Type="String" />
                <asp:Parameter Name="original_SendTime" Type="DateTime" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Content" Type="String" />
                <asp:Parameter Name="SendTime" Type="DateTime" />
            </InsertParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
